let timeout = null

/**
 * 简单防抖
 * @param {*} fn
 * @param {*} duration
 */
export function debounce(fn, duration = 500) {
  log('eventUtils.js/debounce.sliderMax', {fn, duration})
  if(timeout) {
    clearTimeout(timeout)
    timeout = null
  }
  timeout = setTimeout(() => {
    log('eventUtils.js/debounce.sliderMax1111', {fn, duration})
    fn.call(this, arguments);
  }, duration);
}
